home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
M-More Monthly Disks
/
(c)ma.d64
/
alphasort.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
4KB
|
126 lines
5 PRINT""
10 PRINT"[147]WANT INSTRUCTIONS?(Y/N)
13 [161] A$:[139]A$[178]""[167]13
14 [139]A$[179][177]"Y"[167][137]106
15 [153]"WOULD YOU LIKE TO PRINT INSTRUCTIONS ON A PRINTER? (Y/N)"
18 [161]B$:[139]B$[178]""[167]18
19 [139]B$[179][177]"Y"[167][137]22
20 [159]4,4,1:[157]4
22 [153]:[153]"THIS PROGRAM SORTS LISTS THAT YOU TYPE, INTO ALPHABETIC ORDER."
24 [153]"YOU CAN SAVE THESE ON DISK. ONCE YOU RUN THE PROGRAM IT WILL ASK"
26 [153]"WHETHER YOU WISH TO CHANGE THE NAME OF THE SEQUENTIAL FILE ON THE DISK"
28 [153]"FOR EXAMPLE YOU MIGHT SAVE 'BOOKTITLES' UNDER ONE FILENAME"
30 [153]"AND 'TPUGPROGS' UNDER ANOTHER, SO YOU HAVE TO GIVE DIFFERENT FILENAMES."
35 [153]"AT THE MOMENT THE SEQUENTIAL FILE IS CALLED 'PROGRAM'.
37 PRINT"AFTER USING 'PROGRAM' ONCE YOU WILL WANT TO USE A DIFFERENT NAME"
40 PRINT"LIKE 'BOOKLIST' OR 'TPUGPROGS' FOR OTHER SEQUENTIAL FILES."
42 PRINT"IF YOU DON'T NEED TO CHANGE THE FILE NAME, HIT 'RETURN'"
43 PRINT"YOU WILL SEE A MENU: 1.LOAD;2.ADD;3.SAVE;4.PRINT;5.VIDEO"
44 IFB$<>"N"THENGOTO48
45 PRINT"PRESS RETURN[146]"
46 GETS$:IFS$<>CHR$(13)THEN46
48 PRINT"IF YOU HAVE NOT YET SAVED A LIST, PRESS 2 AND START TYPING A LIST"
49 PRINT"YOU MAY TYPE IN ALMOST2 (40 COL.)LINES--BUT!!!DON'T LEAVE SPACES"
52 PRINT"FOR EXAMPLE, HERE ARE NAMES OF TPUG DISKS--WITH COMMENTS"
55 PRINT " ? YESTERDAY.C---THE BEATLES--TUNE--NOT THAT GOOD--------CTU"
58 PRINT " ? DIALER.C---A PROGRAM THAT DIALS--TPUG TELEPHONE NOS.--CT1"
60 PRINT " ? PONZO TUTOR.1.C--REALLY USEFUL---FOR LEARNING BASIC---CTT"
63 PRINT"......AND SO ON.....":PRINT
66 PRINT"THE PROG.ALLOWS FOR 300 ITEMS, BUT CAN BE INCREASED IN LINE 140"
67 PRINT"TO FINISH ENTERING ITEMS, TYPE 'END' AND PRESS RETURN":PRINT
69 IFB$<>"N"THENGOTO72
70 PRINT"PRESS RETURN[146]"
71 GETD$:IFD$<>CHR$(13)THEN71
72 PRINT"NOW THE C64 WILL START SORTING-THIS CAN TAKE +10MINS FOR LONG LISTS"
73 PRINT"(MAYBE A MACHINE LANGUAGE EXPERT CAN SPEED THIS UP,LINES:310-410)
74 [139]B$[179][177]"N"[167][137]78
78 [153]"THEN THE MENU WILL APPEAR AND YOU CAN SAVE OR PRINT ON PRINTER";
81 [153]" OR SCREEN (VIDEO) YOUR SORTED LIST"
84 [153]"!!!!IF YOU WANT TO ADD TO A LIST ALREADY ON DISK, THEN LOAD FIRST"
87 [153]"THEN PRESS 2 (FROM MENU) ADD NEW LINES AND SORT AGAIN":[153]
89 [153]"IF ANYONE IMPROVES ON THIS PROGRAM PLEASE LET ME KNOW"
90 [153]"CLIFF JANSEN, 549 STEELES W., #46, WILLOWDALE, ONT. M2M 3Y1";
91 [153]": TPUG#9743"
92 [139]B$[179][177]"Y"[167][137]94
93 [152]4:[160]4
94 [153]"PRESS RETURNWAIT"
95 [161]K$:[139]K$[179][177][199](13)[167]95
106 [153]"LOADTHE FILENAMES TO SAVE & LOAD DATA"
108 [153]"ARE IN LINES 710 AND 805. ":[153]
110 [153]"IF YOU WISH TO CHANGE THEM PRESS RUNSTOPWAIT IF NOT"
112 [153]"PRESS RETURNWAIT"
114 [161]A$:[139]A$[179][177][199](13)[167][137]114
120 [151]646,1
130 [156]
140 N[178]300:E$[178]"END"
150 [134]A$(N)
151 [153]"LOADMAKE YOUR CHOICE":[153]"1. LOAD"
153 [153]"2. ADD":[153]"3. SAVE"
154 [153]"4. PRINT"
158 [153]"5. VIDEO"
164 [161]AN$:[139]AN$[178]""[167]164:[139]AN$[179]"1"[176]AN$[177]"5"[167][137]164
165 M[178][197](AN$)
166 [145]M[137]700,600,800,435,900
169 K[178]1
170 [139]K[177]N[167]250
180 [153]K;:[153]" ";:[133]R$
185 [139]R$[178]E$[167]250
200 A$(K)[178]R$:K[178]K[170]1:[137]170
250 K[178]K[171]1:[139]K[177]0[167]300
260 [153]"**NO INPUT TO SORT**"
270 [137]169
300 [153]K;"ITEMS ENTERED":[129]T[178]1[164]999:[130]T
310 [153]"LOADI AM SORTING YOUR PROGRAMS"
315 [153]"PLEASE! PLEASE! BE PATIENT"
350 [139]K[178]1[167]151
360 [129]J[178]K[164]2[169][171]1
370 R$[178]A$(1):F[178]1
380 [129]L[178]2[164]J
390 [139]A$(L)[177]R$[167]R$[178]A$(L):F[178]L
400 [130]:A$(F)[178]A$(J):A$(J)[178]R$
410 [130]:[137]151
435 [153]"LOADPRINTING"
440 [159]4,4,3:[157]4
500 [129]J[178]1[164]K
510 [153],A$(J)
520 [130]
530 [152]4:[160]4
550 [137]151
600 [153]"LOAD"
610 [153]:[153]:[153]"ENTER EACH ITEM."
650 [153]"PRINT 'END' TO STOP"
655 [139]K[177]1[167]K[178]K[170]1:[139]K[177]1[167][137]170
660 [137]169
700 [153]"LOADLOADING"
710 [159]2,8,2,"0:PROGRAM,S,R"
711 [132]2,K
715 J[178]1
721 [132]2,A$(J)
725 J[178]J[170]1
727 [139]J[177]K[167]733
730 [137]721
733 [160]2
735 [137]151
800 [153]"LOADSAVING"
805 [159]2,8,2,"@0:PROGRAM,S,W"
806 [152]2,K
810 [129]J[178]1[164]K
815 [152]2,A$(J)
820 [130]
830 [160]2
835 [137]151
900 [153]"LOADHOW FAST DO YOU WISH TO GO?"
902 [153]"1. VERY FAST"
904 [153]"2. FAST"
906 [153]"3. SLOW"
908 [161]B$:[139]B$[178]""[167]908
910 M[178][197](B$)
911 [153]"LOAD"
912 [145] M [137] 914,916,918
914 [129]J[178]1[164]K:[153]"";A$(J):[129]T[178]1[164]100:[130]T:[130]J
915 [129]T[178]1[164]999:[130]T:[137]151
916 [129]J[178]1[164]K:[153]"";A$(J):[129]T[178]1[164]200:[130]T:[130]J
917 [129]T[178]1[164]800:[130]T:[137]151
918 [129]J[178]1[164]K:[153]"";A$(J):[129]T[178]1[164]500:[130]T:[130]J
919 [129]T[178]1[164]600:[130]T:[137]151